<template>
  <!-- <e-table
    ref="eTable"
    :tableData="goodsData"
    :columns="supplierCol"
    :loading="supplierLoading"
    :pageObj="null"
    :border="null"
    @row-click="handleRowClick"
  />-->
  <div v-if="goodsData.length > 0">
  <vue-marquee :duration="600" :interval="2000" >
    <item v-for="(i,index) in goodsData" :content="i.type" :key="index"></item>
  </vue-marquee>
  </div>
</template>

<script>
import { getSupplierDirTotal } from '@/api/monitor'
import VueMarquee from 'vue-marquee'

export default {
  components: {
    VueMarquee,
    item: {
      props: ['content'],
      template: '<div style="height: 36px; line-height: 36px;">{{content}}</div>'
    }
  },
  data() {
    return {
      goodsData: [],
      supplierCol: [
        {
          label: '分类',
          prop: 'type'
        },
        {
          label: '数量',
          prop: 'total'
        }
      ],
      supplierLoading: false
    }
  },
  mounted() {
    // 供应商物资目录
    getSupplierDirTotal().then(res => {
      this.goodsData = res.data
    })
  },
  methods: {
    handleRowClick(row, column, event) {
      console.log('row', row, column, event)
      this.$router.push({
        path: '/monitor/monitor-supplierDetail',
        query: { dictionariesId: row.dictionariesId }
      })
    }
  }
}
</script>
